<?php
/**
 * @category ContentEngine
 * @package Goatherd\Content\Engine
 *
 * @author Copyright (c) 2012 Maik Penz <maik@phpkuh.de>
 * @version $Id: ISource.php 91 2012-03-29 22:11:54Z maik@phpkuh.de $
 *
 * This file is part of Goatherd library.
 *
 * Goatherd library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * Goatherd library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Goatherd library. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Goatherd\Content\Engine\Source;

use Goatherd\Content\Engine\Writer\IWriter;

use Goatherd\Content\Engine\Reader\IReader;

/**
 * Sources provide access and processing capatibilities to queues.
 * Reader/ writer method calls can be observed by mappers.
 *
 * @todo concept for source register/ unregister is not yet final
 *
 * @category ContentEngine
 * @package Goatherd\Content\Engine
 * @subpackage Source
 */
interface ISource
extends \SplSubject
{
    /**
     *
     * @param array $options
     */
    public function __construct($options = array());

    /**
     *
     * @param \Goatherd\Content\Engine\Reader\IReader $reader
     */
    public function setReader(IReader $reader);

    /**
     *
     * @param \Goatherd\Content\Engine\Writer\IWriter $writer
     */
    public function setWriter(IWriter $writer);

    /**
     * Create an empty item.
     *
     * @return \Goatherd\Content\Engine\Queue\IItem
     */
    public function createItem();

    /**
     *
     * @return \Goatherd\Content\Engine\Queue\ItemCollection
     */
    public function getQueue();

    /**
     * Writer registration event.
     *
     */
    public function register();

    /**
     * Writer unregistration event.
     *
     */
    public function unregister();
}